package com.ruoyi.web.controller.xcx;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.ACheckInfor;
import com.ruoyi.system.domain.vo.HgACheckInforVO;
import com.ruoyi.system.service.IACheckInforService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 打卡Controller
 *
 * @author ruoyi
 * @date 2024-05-30
 */
@RestController
@RequestMapping("/xcx/aCheckInfor")
public class XcxACheckInfor extends BaseController {

    @Autowired
    private IACheckInforService aCheckInforService;

    /**
     * 查询打卡详细列表
     */
    @GetMapping("/xcxList")
    public TableDataInfo xcxList(HgACheckInforVO hgACheckInforVO)
    {
        startPage();
        List<HgACheckInforVO> list = aCheckInforService.selectACheckInforXcxList(hgACheckInforVO);
        return getDataTable(list);
    }

    /**
     * 根据id 查询详情
     * @param id
     * @return
     */
    @GetMapping("/xcxGetInfor")
    public AjaxResult xcxGetInfor(Long id)
    {
        return success(aCheckInforService.selectACheckInforByXcxId(id));
    }

    /**
     * 保存用户上传的数据
     * @param aCheckInfor
     * @return
     */
    @PostMapping("/xcxAdd")
    public AjaxResult xcxAdd(@RequestBody ACheckInfor aCheckInfor)
    {
        return success(aCheckInforService.insertAXcxCheckInfor(aCheckInfor));
    }
}
